module.exports = {
  rootDir: __dirname,
  mode: 'universal',
  // or
  pageTransition: {
    name: 'opacity',
    mode: 'out-in'
  },
  // server: {
  //   host: '192.168.88.88' // default: localhost
  // },
  // 登入认证中间件
  router: {
    middleware: 'auth'
  },
  // 跳过interest
  telemetry: false,
  // 全局样式配置
  css: [
    '@/assets/css/global.css'
  ],
  /*
  ** Headers of the page
  */

  head() {
    return {
      meta: [
        { charset: 'utf-8' },
        // content 适配底部 安全区
        { name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover' },
        { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
      ],
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
        { rel: 'stylesheet', href: '//at.alicdn.com/t/font_2491327_opm8oua39wm.css' }
      ]
    }
  },
  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#fff' },
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    { src: '~/plugins/buggyfill.js', ssr: false },
    { src: '~/plugins/vant.js',ssr:true },
    { src: '~/plugins/axios.js' },
    { src: "~/plugins/longClick.js" },
    { src: "~/plugins/globalFilter.js" }
  ],
  /*
  ** Nuxt.js dev-modules
  */
  buildModules: [
    // Doc: https://github.com/nuxt-community/eslint-module
    // '@nuxtjs/eslint-module'
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    'cookie-universal-nuxt',
    'nuxt-route-meta',
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios'
  ],
  /*
  ** Axios module configuration
  ** See https://axios.nuxtjs.org/options
  */
  axios: {
    proxy: true // Can be also an object with default options
  },

  proxy: {
    '/v1': 'http://localhost:3000'
  },
  /*
  ** Build configuration
  */
  // 自定义postcss vw 适配
  build: {
    postcss: {
      plugins: {
        'postcss-px-to-viewport': {
          viewportWidth: 375, // (Number) The width of the viewport.
          viewportHeight: 667, // (Number) The height of the viewport.
          unitPrecision: 3, // (Number) The decimal numbers to allow the REM units to grow to.
          viewportUnit: 'vw', // (String) Expected units.
          selectorBlackList: ['.ignore', '.hairlines'], // (Array) The selectors to ignore and leave as px.
          minPixelValue: 1, // (Number) Set the minimum pixel value to replace.
          mediaQuery: false // (Boolean) Allow px to be converted in media queries.
        },
        // 为了解决vw兼容问题
        'postcss-viewport-units': {}
      }
    }
  }
}
